package system

import (
	"context"
	"gf-assistant/internal/common/factory"
	"gf-assistant/internal/system/parameter"
)

// Role 账号控制器类
var Role = RoleController{service: "system.RoleService"}

type RoleController struct{ service string }

func (r *RoleController) ListRole(ctx context.Context, req *parameter.ListRoleReq) (res *parameter.ListRoleRes, err error) {
	return GetRoleService().ListRole(ctx, req), nil
}

func (r *RoleController) SaveRole(ctx context.Context, req *parameter.SaveRoleReq) (res *parameter.SaveRoleRes, err error) {

	return GetRoleService().SaveRole(ctx, req), nil
}
func (r *RoleController) DeleteRole(ctx context.Context, req *parameter.DeleteRoleReq) (res *parameter.DeleteRoleRes, err error) {

	return GetRoleService().DeleteRole(ctx, req), nil
}
func GetRoleService() *RoleService {
	return factory.Get(Role.service).(*RoleService)
}
